const app = getApp(),url = app.globalData.url;
Page({

  data: {
    alllist:[
      
    ],
  },
  searchBut:function(e){
    var that = this
    var uid = wx.getStorageSync('user_massage')
    let status = e.detail.value
    var zphid = that.data.zphid
    console.log('执行search',status)
    wx.request({
      header: {
        'content-type': 'application/json' // 默认值
      },
      url:url+ 'jobFair/getJFAllEnterprise',
      method: "GET",
      data:{
        jf_id:zphid,
        pageNum:1,
        pageSize:1500,
        companyName:status,
      },
      success:function(res){
        console.log("搜索",res);
        var ret = res.data
        if(ret.code == 200){
          var alllist = ret.data.content
          that.setData({alllist:alllist})
        }else{
          wx.showToast({
            title: ret.msg,
            icon:'none'
          })
        }
      }
    })
  },
  onLoad: function (options) {
    console.log(options)
    let that = this
    that.setData({
      zphid:options.zphid
    })
    that.youxuan(options.zphid)
  },
  youxuan(id){
    var that = this
    wx.showLoading({
      title: '加载中',
    })
    // https://www.qugouzhigong.top/dgdx-Api/jobFair/getJFAllEnterprise?pageNum=1&pageSize=36&jf_id=1369601948444463105&companyName=
    wx.request({
      url:url+'jobFair/getJFAllEnterprise',
      method: "GET",
      data:{
        jf_id:id,
        pageNum:1,
        pageSize:150,
        companyName:'',
      },
      success:function(res){
        console.log("1",res);
        var ret = res.data
        if(ret.code == 200){
          wx.hideLoading()
          // listdata=listdata.concat(arr2)
          that.setData({alllist:ret.data.content})
        }else{
          wx.hideLoading()
          wx.showToast({
            title: ret.message,
            icon:'none'
          })
        }
      }
    })
  },
  prisedetail(e){
      let did = e.currentTarget.dataset.id
      wx.navigateTo({
        // url: '/HomePage/jobfairdetail/jobfairdetail?id='+did,
        url: '/HomePage/prisedetail/prisedetail?id='+did,
      })
    },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    var that = this
    
  },
  
})